JP5-280454A, published by the Japan Patent Office in 1993, focuses on the fact that two types of fuel, namely high octane fuel (octane number 98) and low octane fuel (octane number 91), are commercially available. When a fuel cap is opened, an operation is performed initially at a base ignition timing for high octane fuel, and a determination is made as to whether or not knocking occurs. If knocking occurs in a predetermined setting region, the predetermined setting region being a region where knocking occurs when high octane fuel is used, it is determined that high octane fuel is being used. If knocking occurs in a region other than the predetermined setting region, it is determined that low octane fuel is being used. When it is determined that high octane fuel is being used, the operation is continued as is, and when it is determined that low octane fuel is being used, the operation is continued after switching to a base ignition timing for low octane fuel.